package com.ljl.rest;


import com.ljl.service.SignInLogService;
import com.ljl.service.dto.SignInLogQueryCriteria;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Set;

/**
 * @author 刘家良
 * @date 2022/09/09 00:16
 * @description
 */
@RequestMapping("/api/signInLog")
@RestController
@RequiredArgsConstructor
public class SignInLogController {

    private final SignInLogService signInLogService;

    @GetMapping
    public ResponseEntity<Object> queryAll(SignInLogQueryCriteria criteria, Pageable pageable) {
        return new ResponseEntity<>(signInLogService.queryAll(criteria, pageable), HttpStatus.OK);
    }

    @DeleteMapping
    public ResponseEntity<Object> update(@RequestBody Set<Long> ids) {
        signInLogService.deleteAll(ids);
        return new ResponseEntity<>(HttpStatus.OK);
    }

}
